Skip to content

Re-apply Jackson 2.18.6 upgrade with round-trip test coverage#599

Open
darklight3it wants to merge 25 commits intomainfrom
dmelfi/jackson-2.18.6-upgrade
Open

Re-apply Jackson 2.18.6 upgrade with round-trip test coverage#599
darklight3it wants to merge 25 commits intomainfrom
dmelfi/jackson-2.18.6-upgrade

Conversation

@darklight3it
Copy link
Copy Markdown
Contributor

@darklight3it darklight3it commented Mar 25, 2026

Issue #, if available:

Related to #594

Description of changes:

Upgrading Jackson in the serialization package from 2.15.4 to 2.18.6 . The previous update was reverted because of a suspected regression on aws-lambda-serialization here.

The root cause of the failure was not in the published artifact. I confirmed this running the new suite of tests introduced in #598 against the 1.3.0 version of aws-lambda-serialization.

cd aws-lambda-java-tests  
mvn clean test

[INFO] Results:
[INFO] 
[INFO] Tests run: 125, Failures: 0, Errors: 0, Skipped: 0
[INFO] 
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  3.117 s
[INFO] Finished at: 2026-03-26T12:10:43Z

The real root cause was in aws-lambda-java-serializzation.yml, specifically in:

mvn -B package install --file aws-lambda-java-serialization/pom.xml

Both package and install execute the shade goal from maven-shade-plugin, responsible for avoiding dependency collision with user code.
This plugin executes a non idempotent action in DateTimeModule. Specifically moving the registering namespace in the following way:

"com.amazonaws.lambda.unshade.thirdparty.org.joda.time.DateTime"
                    │
                    │ rule: unshade.thirdparty.org.joda.time → org.joda.time
                    ▼
         "org.joda.time.DateTime"
                    │
                    │ rule: org.joda.time → com.amazonaws.lambda.thirdparty.org.joda.time
                    ▼
"com.amazonaws.lambda.thirdparty.org.joda.time.DateTime"

Thus not registering the correct event imported from the aws-lambda-java-events library. The tests are now failing because the default Joda Time jackson serializer changed the constructor signature.

Target (OCI, Managed Runtime, both):

Both

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

Davide Melfi added 16 commits March 24, 2026 11:43
Add JSON test fixtures and round-trip test cases for CognitoEvent,
DynamodbTimeWindowEvent, IoTButtonEvent, and KinesisTimeWindowEvent.
These were the only events registered in LambdaEventSerializers
SUPPORTED_EVENTS that lacked test fixtures.

Fixtures based on official AWS Lambda documentation examples. Time
window event fixtures use round-trip-safe date formats to avoid
coercion issues.

Coverage: 32 passing + 2 known failures (34 total, up from 30).
Add UnregisteredEventSerializationRoundTripTest covering events not in
LambdaEventSerializers.SUPPORTED_EVENTS: 10 Cognito UserPool triggers,
5 Kinesis Analytics events, 2 API Gateway V2 WebSocket, 2 AppSync,
1 S3 Batch, and 1 TimeWindow response. S3ObjectLambdaEvent is a known
failure (Lombok xAmzRequestId naming issue).

Split SerializationRoundTripTest into registered (34 tests) and
unregistered (22 tests) for clarity. Total: 56 tests, 53 passing,
3 known failures.
Add ResponseEventSerializationRoundTripTest covering all 11 response
event types in aws-lambda-java-events. 9 pass cleanly, 2 are known
failures (IamPolicyResponse, IamPolicyResponseV1 — getPolicyDocument()
returns Map<String,Object> instead of the PolicyDocument POJO, making
round-trip impossible by design since these are serialize-only types).

Also update SerializationRoundTripTest comment for
APIGatewayV2CustomAuthorizerEvent to clarify the date format change
is a lossy transformation, not a bug.

Total: 69 tests (34 registered + 22 unregistered + 11 response + 2
LambdaEventAssertTest), all green. Coverage now 66/68 event classes
(97%).
@darklight3it darklight3it force-pushed the dmelfi/jackson-2.18.6-upgrade branch from e4c4c62 to a3ae0f2 Compare March 26, 2026 15:05
@darklight3it darklight3it force-pushed the dmelfi/jackson-2.18.6-upgrade branch from 01edeed to 1f4c1fc Compare March 26, 2026 17:42
@darklight3it darklight3it marked this pull request as ready for review March 26, 2026 17:43
@darklight3it darklight3it self-assigned this Mar 27, 2026
@darklight3it darklight3it requested a review from maxday March 27, 2026 12:06
@darklight3it darklight3it force-pushed the dmelfi/jackson-2.18.6-upgrade branch from 72e08f9 to 97f7cb0 Compare March 27, 2026 15:21
@darklight3it darklight3it changed the base branch from dmelfi/improve-serialization-testing to main March 30, 2026 15:22
@codecov
Copy link
Copy Markdown

codecov bot commented Mar 30, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 65.38%. Comparing base (3d9661e) to head (b92aad6).

Additional details and impacted files
@@            Coverage Diff            @@
##               main     #599   +/-   ##
=========================================
  Coverage     65.38%   65.38%           
  Complexity      211      211           
=========================================
  Files            34       34           
  Lines           988      988           
  Branches        142      142           
=========================================
  Hits            646      646           
  Misses          290      290           
  Partials         52       52           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants